<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>vue1</title>
        <script src="js/vue.js"></script>
        <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    </head>
    <body>
        <input type="button" value="get请求" class="get">
        <input type="button" value="post请求" class="post">
        <div id="app">
            
        </div>
        <script>
            /*
            https://autumnfish.cn/api/joke/list
            get 
            num 笑话条数
            */ 
            
            let getAction = document.querySelector(".get")
            getAction.onclick = function(){
                // console.log("aaaaa")
                axios.get("https://autumnfish.cn/api/joke/list?num=3")
                .then(function (response){
                    console.log(response)
                })
            }
            /*
            https://autumnfish.cn/api/user/reg
            post
            username
            */
            document.querySelector(".post").onclick = function(){
                axios.post("https://autumnfish.cn/api/user/reg", {username:"aiyoubug"})
                .then(function(response){
                    console.log(response)
                })
            }
            let vue = new Vue({
        // 告诉vue的实例对象，将来需要控制界面上的那个区域
                el:'#app',
                data:{
                    name:"内容1"
                }
            });
        </script>
    </body>
</html>